package io.arukas;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class BuildByDockerApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(BuildByDockerApplication.class, args);
    }

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @GetMapping("/")
    public String welcome() {
        logger.info("....................");
        return "build by docker";
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(BuildByDockerApplication.class);
    }
}
